package cn.wzvtc.soft14;

import org.hibernate.sql.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by linji on 2016/3/18.
 */
@Service
public class KebiaoService {
    /**根据周次和班级返回班级课表信息
     * @param week -周次
     * @param clazz- 班级
     * @return 课表信息
     */
    public List getKebiao() {
        Ke k1=new Ke();
        k1.setAddr("明德楼803");
        k1.setTime(3);
        k1.setEndtime(4);
        k1.setWeek(2);
        k1.setTeach("项道东");
        k1.setName("动态编程");

        Ke k2=new Ke();
        k2.setAddr("明德楼805");
        k2.setTime(1);
        k2.setEndtime(2);
        k2.setTeach("项东");
        k2.setName("动编程");
        k2.setWeek(4);
        List list=new ArrayList();

        list.add(k1);
        list.add(k2);
        return list;

    }

    @Autowired
    private KebiaoRepo kebiaoRepo;

    public void save(Ke k) {
        this.kebiaoRepo.save(k);
    }
    List selete(){
        return (List)this.kebiaoRepo.findAll();

    }
    List selete2(){
        return (List)this.kebiaoRepo.findAll();

    }

}
